//app.js
var netWork = require('./utils/netWork.js')
App({
  // globalConfigUrl: 'http://172.30.3.74:5580',
  globalConfigUrl: 'https://service.neuqsoft.com/ggfw/citizen/demo',
  globalFlag: false,
  onLaunch(options) {
    let str = JSON.stringify(options)
    let code = JSON.parse(str).query
    wx.setStorageSync('app_param', JSON.stringify(code))
    // wx.showModal({
    //   title: 'cancelColor',
    //   content: JSON.stringify(options)
    // })
  },
  initData() {
    let token = wx.getStorageSync('token')
    if (!token) {
      this.getCode()
    }
    console.log('session', token)
  },
  getCode() {
    let url = this.globalConfigUrl + "/api/scene3/token?code=kScSHEw9WtINF3Tya1lSTeLWRWLSFrUj&redirectUri=http://10.19.92.209:8990"
    netWork.requestLoading(url, {}, 'get', (res) => {
      wx.setStorageSync('token', JSON.stringify(res))
    })
  }
})